/* Special characters */
var scSafeSep = '\x17', scItemSep = ';', scEquals = '=', scColon = ':', scAmpersand = '&'; scDateSep = '/';

/* Keyboard codes */
var kcUpArrow = 38, kcDownArrow = 40;

/* ReadyState */
var rsUninitialized = 'uninitialized', rsLoading = 'loading', rsLoaded = 'loaded', rsInteractive = 'interactive', rsComplete = 'complete';

/* Frame ID's */
var idMain = 'appMain', idMaster = 'master', idMenuSep = 'appMenuSeparator', idLeftPane = 'appLeftPane', idRightPane = 'appRightPane',
	idPing = 'ping', idLogo = 'appLogo', idMenu = 'menu', idTree = 'appTree', idNavigation = 'appNavigation', 
    idLoginForm = 'login_form', idAppForm = 'app_form', idSplash = 'splash', idNoSession='noSession', idFormSelector='app_formSelector',
    liveFrames = 4;

/* Repository actions */
var raClickMenuTree = 0, raCloseForm = 1, raButtonClick = 2, raRemoteOpen = 3, raRemoteSelect = 4, raPost = 5, raLogout = 6, raSetFilter = 7,
	raOpenFilter = 8, raGetData = 9, raOperateDataset = 10, raGetImage = 11, raResetFilter = 12, raGetBlob = 13, raPrint = 14, raPrintSelected = 15, 
	raCloseParent = 16, raSetSort = 17, raSetSearch = 18, raPrintReport = 19, raConfirmPrevious = 20, raClosePrevious = 21, raCleanup = 22,
	raEditBlob = 23, raSetBlob = 24, raQuickFilter = 25, raNewPassword = 26, raCallPFunc = 27, raGetRichTextImage = 28, raSetRichTextImage = 29, raOpenRichTextForm = 30,
	raUpdateGrid = 31;

var raActionNames   = new Array('item', 'close', 'click', 'ropen', 'rselect', 'post', 'logout', 'sfilter', 
	'ofilter', 'gdata', 'odset', 'gimage', 'rfilter', 'gblob', 'print', 'print', 
	'', 'ssort', 'ssearch', 'report', '', '', 'cleanup',
	'eblob', 'sblob', 'qfilter', 'snewpwd', 'callpfunc', 'getRTImage', 'setRTImage', 'openRTForm', 'updateGrid');

/* Form properties */
var fmClientOffset  = 10,
    fmBorderWidth   = 3,
    fmDragbarHeight = 16,
    fmSchema        = "classic",
    hiMinimizeIcon  = "Minimize",
    hiMaximizeIcon  = "Maximize",
    hiRestoreIcon   = "Restore",
    hiCloseIcon     = "Close";

/* Global application settings */
var appWebDirName = 'webic', appVersion = '1.0.0', appQIScriptVersion = appQIVersion + '.1', appPingInterval = 300000, appDebugEnabled = false,
    appCgiPath = './cgi-bin/icdisp.exe', portalCgiPath = './PortalIC.aspx?portalAct=proxy',
    appImageDir;


{
  var lIndex = window.location.pathname.lastIndexOf('/');
  appImageDir = window.location.pathname.substr(0, lIndex + 1) + 'images/%1/' + fmSchema + '/';
}
// var appImageDir = '/' + appWebDirName + '/images/%1/' + fmSchema + '/';


var sysMessages = [];
var sysMsgTypes = [];
sysMessages['303118,10'] = 'Exclusive operation is currently being processed on the Application Server.\nLogin-in is not possible at this moment.\nPlease wait for a few minutes and try again.';
sysMsgTypes['303118,10'] = 1;
sysMessages['1'] = 'IC cannot connect to the Application Server.\nPlease wait for a few minutes and try again.\nIf the problem persists, contact your IC provider.';
sysMessages['LOGIN_-3'] = sysMessages['LOGIN_-2'] = sysMessages['LOGIN_-1'] = 'Incorrect login information or login not allowed.';
sysMessages['LOGIN_1'] = 'Minimal password length not reached.';
sysMessages['LOGIN_2'] = 'Password expired.\nPlease log-in using standard client and change your password or contact your IC provider.';
sysMessages['LOGIN_3'] = 'Dual login not allowed.';



if (((window.navigator.userLanguage) && (window.navigator.userLanguage == 'cs')) || 
	((window.navigator.language) && (window.navigator.language == 'cs')) )
{
	sysMessages['303118,10'] = 'Probíhá operace s exklusivním přístupem a momentálně není možné se přihlásit.\nVyčkejte prosím několik minut a zkuste se přihlásit znovu.';
	sysMessages['1'] = 'IC se nepodařilo připojit k Aplikačnímu Serveru.\nVyčkejte prosím několik minut a zkuste se přihlásit znovu. V případě, že problém přetrvává, kontaktujte svého poskytovatele IC.';
	sysMessages['LOGIN_-3'] = sysMessages['LOGIN_-2'] = sysMessages['LOGIN_-1'] = 'Chybné přihlašovací údaje, nemáte dostatečná práva pro přihlášení, nebo došlo k chybě spojení.';
	sysMessages['LOGIN_1'] = 'Nedostatečná délka hesla.';
	sysMessages['LOGIN_2'] = 'Vypršela platnost Vašeho hesla.\nProsím připojte se standardním klientem a proveďte změnu hesla, nebo kontaktujte svého poskytovatele IC.';
	sysMessages['LOGIN_3'] = 'Duplicitní přihlášení není povoleno.';
}


/* Form state */
var fsNormal = 0, fsMinimized = 1, fsMaximized = 2;

/* Dyna state */
var dsForm = 0, dsDesign = 1, dsDetail = 2, dsJoin = 3, dsF4To = 4, dsF4 = 5, dsNoOpen = 6, dsMultiSelect = 7, dsSelect = 8;

/* TabFolder properties */
var tfTabHeight = 16;

/* DateTime parts */
var dpYear = 0, dpMonth = 1, dpDay = 2, dpHour = 3, dpMinute = 4, dpSecond = 5;

/* Misc */
var maxInt = 2147483647;

/* Label alignment */
var laLeft = 0, laRight = 1, laTop = 2, laBottom = 3, laNone = 4;
var paddingDots = " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .";

/* Image properties */
var ipStretch = 1, ipKeepRatio = 2;

/* Message dialog types */
var mtInformation = 1, mtQuestion = 2, mtWarning = 3, mtError = 4;

/* Message dialog buttons and results */
var mbYes = 2, mbNo = 4, mbOK = 8, mbCancel = 16, mbHelp = 32;

/* Common method flag */
var cmNone = 0, cmRender = 2, cmLoad = 4, cmSave = 8;

/* Tree node type */
var ntRoot = 0, ntFolder = 1, ntLeaf = 2;

/* Editor types */
var etSimple = 0, etRemote = 1, etMemo = 2, etSpinner = 3;

/* Button flags */
var bfNone = 0, bfPostData = 2;

/* TreeView Expand Type */
var tvetUndefined = -1, tvetNoChildren = 0, tvetCollapsed = 1, tvetExpanded = 2;

/* Grid properties */
var grdDefaultWidth = 150, grdMinWidth = 30;

/* Field types */
var ftString = 0, ftInteger = 1, ftFloat = 2, ftDate = 3, ftTime = 4, ftDateTime = 5, ftEnum = 6, ftSet = 7, ftPicture = 8, ftMemo = 9;

/* Field flags */
var ffNone = 0, ffReadOnly = 2, ffRequired = 4; ffHidden = 8; ffPassword = 16; ffRemote = 32, 
	ffNoRecStatusChange = 64, ffLocalField = 128, ffHasChangeMacro = 256, ffIsNoData = 512, ffInvisible = 1024, ffSelect = 2048;

/* Dataset movements */
var dmFirst = 0, dmFastPrior = 1, dmPrior = 2, dmNext = 3, dmFastNext = 4, dmLast = 5;

/* Dataset operations */
var doGotoRow  = 0, doInsert = 1, doDelete = 2, doCancel = 3, doToggleNode = 4;

/* Dataset flags */
var dfNone = 0, dfReadOnly = 2, dfMaster = 4, dfNoSort = 8, dfNoFilter = 16, dfNoInsert = 32;

/* Record status */
var rsUnchanged = 0, rsAdded = 1, rsModified = 2, rsDeleted = 3;

/* Record flags */
var rfNone = 0, rfReadOnly = 2;

/* Record Field flags */
var rffNone = 0, rffReadOnly = 1, rffFull = 2;


/* Edit Control Flags */
var efHideInvisible = 1;


if (typeof(loadNextScript) != 'undefined')
	loadNextScript();
